DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=Python
version=2.7.3
prefix=/usr
destdir=$(DIR_SYSROOT)
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=www.python.org
DL_PATH=ftp/python/$(version)
DL_SUFFIX=tar.xz

cdefs+=CXX=$(addsuffix -,$(CC_TARGET))c++
cdefs+=CC=$(addsuffix -,$(CC_TARGET))gcc
cdefs+=AR=$(addsuffix -,$(CC_TARGET))ar
cdefs+=RANLIB=$(addsuffix -,$(CC_TARGET))ranlib

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)
cflags+=--cache-file=$(DEF_CACHE)

mflags+=HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
iflags+=HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
pre-build:
	-$(MAKE) -C $< distclean
	cd $<;./configure
	$(MAKE) -C $< python Parser/pgen
	mv $</python $</hostpython
	mv $</Parser/pgen $</Parser/hostpgen
	$(MAKE) -C $< distclean
	echo ac_cv_have_long_long_format=yes >$</$(DEF_CACHE)
	cd $<;$(cdefs) ./configure $(cflags)
	sed -i 's@$$(PGEN) @$$(HOSTPGEN) @g' $</Makefile
	sed -i 's@./$$(BUILDPYTHON)@./$$(HOSTPYTHON)@g' $</Makefile
	sed -i 's/\tPYTHONPATH=/\t-PYTHONPATH=/' $</Makefile
	sed -i '/build_ext.build_extension(self, ext)/a\            return' $</setup.py

normal-build:

post-build:
